package ltd.hxya.novel.book.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import ltd.hxya.novel.book.entity.Book;
import ltd.hxya.novel.book.entity.BookCategory;
import ltd.hxya.novel.book.vo.BookContentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Value;

import java.util.List;

/**
 * <p>
 * 小说表 Mapper 接口
 * </p>
 *
 * @author hxya
 * @since 2022-09-13
 */
@Mapper
public interface BookMapper extends BaseMapper<Book> {

    void addVisitCount(@Param("bookId") Long bookId);

    BookContentVo selectBaseInfoByIndexId(String indexId);

    void addBook(@Param("bookId") String bookId,@Param("categoryId") String categoryId);

    Page<BookCategory> unaddCategory(Page<BookCategory> page,@Param("bookId") String bookId);

    void changeVisitCount(@Value("collect") List<Book> collect);
}
